<?php
define('MANS_', true);
require('./includes/init.php');

$fe = !empty($_REQUEST['fe']) ? $_REQUEST['fe'] : 0;

$kw = !empty($_REQUEST['kw']) ? $_REQUEST['kw'] : '';
$fe_arr = array('moli','baocheng','yilianna','qinggetaoci','qianguteng','qianxunyu','qibaoshu','fenghuangniepan','dulala','daniu','biker','qinggetaoci');
$cat_arr = array('Peking Opera Jewelry','Sterling silver jewelry','yilianna','qinggetaoci','qianguteng','qianxunyu','qibaoshu','Ethnic fashion','dulala','daniu','Retro Jewelry','qinggetaoci');
$sn = @$fe_arr[$fe];
$cat_name = @$cat_arr[$fe];
if($sn)
{
	$size = 36;
	if(!$sm->isCached('category.htm',$cache_id))
	{
		$condition = '';
		if($kw)
		{
			$condition = ' and goods_name like "%'.$kw.'%" '.GOODS_DELETE_SHOW.' ';
		}
		
		$sql = "select count(*) from goods where style_name='".$sn."' $condition ";
		$count = $Main->counts($sql);
		$pagers = $Main->Pager($count,$size,FEATURED.'-'.$fe,$cat_name);
		$position = $Main->position($kw, FEATURED);
		$Main->assigns($position);
		$smarty->assign('cat_str',	@$GLOBALS['_CFG'][$sn]);
		$smarty->assign('cat_name',	$cat_name);
		$smarty->assign('pagers',	$pagers);
		$goods_list = $Goods->freauredGoods($start,$size,$sn,$condition);
		$sm->assign('rand_goods',	$Goods->randGoods(array(),16));
		$position = $Main->position($cat_name, SEARCH);
		$Main->assigns($position);
		$smarty->assign('goods_list',$goods_list);
	}
	$smarty->display('category.htm',$cache_id);
	
}


?>